package com.example.actuator.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author void
 * @date 2022/1/7 9:45
 * @desc
 */
@RestController
@RequestMapping("/interrupt")
public class InterruptController {
    /**
     * 请求进来了，即使客户端中断了请求，也可以正常执行完
     * @throws InterruptedException
     */
    @GetMapping("/test1")
    public void test1() throws InterruptedException {
        System.out.println("请求进来了");
        Thread.sleep(10000);
        System.out.println("请求执行完了");
    }
}
